{
  "properties" : { },
  "id" : "39f4e2d52dac43fba0948e4ac112b44f",
  "script" : null,
  "groupId" : "e35868754ede47b48b4d0f880b121a5d",
  "name" : "在线预览文件次数",
  "createTime" : null,
  "updateTime" : 1673338726115,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "admin",
  "path" : "/fileOnlineNumber",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import log;
import '@post:/mysql/table/fileOnlineNumber/query/byUserFileName' as queryList;
import '@post:/mysql/table/fileOnlineNumber/insert/num' as insertList;
import '@post:/mysql/table/fileOnlineNumber/update/num' as updateList;
var list = queryList();
var num;
if (list.size() > 0) {
    num = list.get(0).download_number::int;
}
if (num == null) {
    num = 0;
}
if (num.equals(0)) {
    num += 1;
    insertList(num);
} else {
    num += 1;
    updateList(num);
}